<?php
return array(
	'defaultScope' => array(
		'condition' => "object_type = 'Travel'",
	),
	'attributeLabels' => array(
		'title' => '旅游路线名称',
		'selectTime' => '上架时间',
		'departure_city' => '出发城市',
		'buildRule' => '建团规则',
		'citys' => '途径城市'
	),

	'cascade' => array(
		'buildRule','citys'
	),

	'relations' => array(
		'profile' => array(CActiveRecord::HAS_ONE, 'GoodsTravel', 'goods_id'),
		'buildRule' => array(CActiveRecord::HAS_ONE, 'TravelBuildRule', 'goods_id'),
		'citys' => array(CActiveRecord::HAS_MANY, 'WayToTheCity','goods_id')
	),

	'rules' => array(
		array('searchCity,scopeVal','safe'),
		array('travel_type,traffic_type,travel_city,departure_city', 'safe'),
	),

	'behaviors' => array(
		'search' => array(
			'class' => 'application.behaviors.SearchBehavior',
			'timeSearch' => 'create_time',
			'priceSearch' => array(
				'attribute' => 'price_dealer',
				'alias' => 'priceInfo',
				'criteria' => array(
					'with' => 'priceInfo',
					'group' => 't.id'
				)
			),
			'searchModel' => 'TravelSearch'
		),
		'fornt' => array(
			'class' => 'coms.behaviors.FrontBehavior',
			'attributes' => array(
				'title' => 'title',
				'img' => 'thumb',
				'time' => array(
					'format' => 'Y-m-d',
					'attribute' => 'create_time'
				)
			),
			'route' => 'provide/channel',
			'view' => 'travelView'
		),
		'citycondtion' => array(
			'class' => 'application.behaviors.CitySearchCondition',
			'with' => array('profile'),
			'citys' => array(
				'travel_province',
				'travel_city',
			),
		),
	),

	'class_id' => Goods::TYPE_TRAVEL,
	'_import' => array(
		array('*', 'models.Goods//*'),
	),
);